﻿using Newtonsoft.Json;
using WMS.FC.Domain.ValueObject.Menu;

namespace WMS.FC.Domain.ValueObject.System
{
    /// <summary>
    /// 页面配置列VO
    /// </summary>
    public class ElColumnVO : ValueObjectBase
    {
        /// <summary>
        /// 键名
        /// </summary>
        [JsonProperty("prop")]
        public string Prop { get; set; } = string.Empty;

        /// <summary>
        /// 字段名称
        /// </summary>
        [JsonProperty("label")]
        public string Label { get; set; } = string.Empty;

        /// <summary>
        /// 列宽
        /// </summary>
        [JsonProperty("width")]
        public string Width { get; set; } = "100px";

        /// <summary>
        /// 是否只读
        /// </summary>
        [JsonProperty("isReadonly")]
        public bool IsReadonly { get; set; }

        /// <summary>
        /// 是否隐藏
        /// </summary>
        [JsonProperty("isHidden")]
        public bool IsHidden { get; set; }

        /// <summary>
        /// 是否可查询
        /// </summary>
        [JsonProperty("isSearchable")]
        public bool IsSearchable { get; set; }

        /// <summary>
        /// 控件类型
        /// </summary>
        [JsonProperty("controlTypeCode")]
        public string ControlTypeCode { get; set; } = string.Empty;

        /// <summary>
        /// 关联字段
        /// </summary>
        [JsonProperty("bindField")]
        public string? BindField { get; set; }

        /// <summary>
        /// 默认值
        /// </summary>
        [JsonProperty("defaultValue")]
        public string? DefaultValue { get; set; }

        /// <summary>
        /// 验证规则
        /// </summary>
        [JsonProperty("rules")]
        public List<ColumnRuleVO> Rules { get; set; } = new List<ColumnRuleVO>();
    }
}
